tarxf ftp://ftp.vim.org/pub/vim/unix/ vim-7.3 .tar.bz2 vim73

PATCHLEVEL=159
for n in $(seq -w 001 $PATCHLEVEL); do
  echo "Grabbing patch $n/$PATCHLEVEL"
  wget -q -O - ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.$n | patch -p0
done

CFLAGS="-D_GNU_SOURCE" ./configure --prefix=/ --mandir=/share/man --localstatedir=/var/lib/vim \
  --disable-nls --disable-netbeans --disable-gui --with-x=no --enable-multibyte
make -C src auto/osdef.h
sed -i '/define stack_t/d' src/auto/config.h
sed -i '/setenv/d' src/auto/osdef.h
sed -i '/putenv/d' src/auto/osdef.h

make
make -j1 VIMRCLOC=/etc DESTDIR=$R install
